package com.liruo.treasureattic.service.api;

import com.liruo.treasureattic.service.api.config.DefaultConfig;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Configuration;

/**
 * @Author:liruo
 * @Date:2022-11-10-12:45:07
 * @Desc  FeignClientsConfiguration默认配置类
 *        测试OptionalDecoder， 是怎么处理响应的，好做响应拦截器，把baseResponse的data去处理，有err就打印
 */
@Configuration
@AutoConfigureAfter(WebMvcAutoConfiguration.class)
@EnableFeignClients(
        basePackages = "com.liruo.treasureattic.service.api.client",
        defaultConfiguration = {DefaultConfig.class}
)
public class FeignApiAutoConfiguration {
//    @Autowired
//    private ObjectFactory<HttpMessageConverters> messageConverters;
//    @Bean
//    public Decoder feignDecoder(ObjectProvider<HttpMessageConverterCustomizer> customizers) {
//        return  new FeignDecoderDelegate(
//                new OptionalDecoder(
//                        new ResponseEntityDecoder(
//                                new SpringDecoder(
//                                        this.messageConverters, customizers)))
//        );
//    }
}
